package com.by.remote;

import com.by.bean.User;
import com.by.fallback.UserFallback;
import com.by.fallback.factory.Userfallbackfactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * description:
 * author:zcx
 * lenovo
 * 时间：2022.06.09.09.46
 */
//@FeignClient(value = "ERP-SYSTEM",fallback = UserFallback.class)
@FeignClient(value = "ERP-SYSTEM",fallbackFactory = Userfallbackfactory.class) //记录降级原因
public interface UserRemoteClient {
    @GetMapping("/user/query/{id}")
    public Map queryUser(@PathVariable("id") String id);
    @GetMapping("/user/login")
    public void login(@RequestParam("username") String username,@RequestParam("password") String password);
    @GetMapping("/user/test1")
    public void testGetMap(@RequestParam Map map);
    @PostMapping("/user/test2")
    public void testPostMap(@RequestBody Map map);
    @PostMapping("/user/test3")
    public void testPosrUser(@RequestBody User user);
    @PostMapping("/user/test4")
    public  void testSpringquerymap(@SpringQueryMap Map map);
    @PostMapping("/user/test5")
    public  void testSpringqueryuser(@SpringQueryMap User user);

}
